.class public final Lcn/cheln/explorer/ds/database/c;
.super Ljava/lang/Object;


# static fields
.field public static a:Ljava/util/Map;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    sput-object v0, Lcn/cheln/explorer/ds/database/c;->a:Ljava/util/Map;

    return-void
.end method

.method public static a(Ljava/lang/String;Landroid/graphics/drawable/Drawable;)Lcn/cheln/explorer/ds/database/a;
    .locals 2

    new-instance v0, Lcn/cheln/explorer/ds/database/CategoryInfo;

    invoke-direct {v0}, Lcn/cheln/explorer/ds/database/CategoryInfo;-><init>()V

    const-string v1, "0 B"

    iput-object v1, v0, Lcn/cheln/explorer/ds/database/CategoryInfo;->size:Ljava/lang/String;

    iput-object p0, v0, Lcn/cheln/explorer/ds/database/CategoryInfo;->displayName:Ljava/lang/String;

    iput-object p1, v0, Lcn/cheln/explorer/ds/database/CategoryInfo;->dIcon:Landroid/graphics/drawable/Drawable;

    new-instance v1, Lcn/cheln/explorer/ds/database/a;

    invoke-direct {v1}, Lcn/cheln/explorer/ds/database/a;-><init>()V

    iput-object v0, v1, Lcn/cheln/explorer/ds/database/a;->a:Lcn/cheln/explorer/ds/database/CategoryInfo;

    return-object v1
.end method

.method public static a()Ljava/util/Map;
    .locals 1

    sget-object v0, Lcn/cheln/explorer/ds/database/c;->a:Ljava/util/Map;

    return-object v0
.end method

.method public static a(Landroid/content/Context;Ljava/util/List;)Ljava/util/Map;
    .locals 5

    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    sput-object v0, Lcn/cheln/explorer/ds/database/c;->a:Ljava/util/Map;

    new-instance v0, Lcn/cheln/explorer/ds/database/CategoryInfo;

    const-string v1, "audio"

    const v2, 0x7f050029

    invoke-virtual {p0, v2}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v3

    const v4, 0x7f02002b

    invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object v3

    invoke-direct {v0, v1, v2, v3}, Lcn/cheln/explorer/ds/database/CategoryInfo;-><init>(Ljava/lang/String;Ljava/lang/String;Landroid/graphics/drawable/Drawable;)V

    sget-object v1, Lcn/cheln/explorer/ds/a;->a:Landroid/net/Uri;

    invoke-static {p1, v0, v1}, Lcn/cheln/explorer/ds/database/c;->a(Ljava/util/List;Lcn/cheln/explorer/ds/database/CategoryInfo;Landroid/net/Uri;)V

    new-instance v0, Lcn/cheln/explorer/ds/database/CategoryInfo;

    const-string v1, "image"

    const v2, 0x7f05002b

    invoke-virtual {p0, v2}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v3

    const v4, 0x7f02002d

    invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object v3

    invoke-direct {v0, v1, v2, v3}, Lcn/cheln/explorer/ds/database/CategoryInfo;-><init>(Ljava/lang/String;Ljava/lang/String;Landroid/graphics/drawable/Drawable;)V

    sget-object v1, Lcn/cheln/explorer/ds/a;->c:Landroid/net/Uri;

    invoke-static {p1, v0, v1}, Lcn/cheln/explorer/ds/database/c;->a(Ljava/util/List;Lcn/cheln/explorer/ds/database/CategoryInfo;Landroid/net/Uri;)V

    new-instance v0, Lcn/cheln/explorer/ds/database/CategoryInfo;

    const-string v1, "video"

    const v2, 0x7f05002a

    invoke-virtual {p0, v2}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v3

    const v4, 0x7f02004e

    invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object v3

    invoke-direct {v0, v1, v2, v3}, Lcn/cheln/explorer/ds/database/CategoryInfo;-><init>(Ljava/lang/String;Ljava/lang/String;Landroid/graphics/drawable/Drawable;)V

    sget-object v1, Lcn/cheln/explorer/ds/a;->b:Landroid/net/Uri;

    invoke-static {p1, v0, v1}, Lcn/cheln/explorer/ds/database/c;->a(Ljava/util/List;Lcn/cheln/explorer/ds/database/CategoryInfo;Landroid/net/Uri;)V

    new-instance v0, Lcn/cheln/explorer/ds/database/CategoryInfo;

    const-string v1, "doc"

    const v2, 0x7f05002c

    invoke-virtual {p0, v2}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v3

    const v4, 0x7f02000d

    invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object v3

    invoke-direct {v0, v1, v2, v3}, Lcn/cheln/explorer/ds/database/CategoryInfo;-><init>(Ljava/lang/String;Ljava/lang/String;Landroid/graphics/drawable/Drawable;)V

    sget-object v1, Lcn/cheln/explorer/ds/a;->e:Landroid/net/Uri;

    invoke-static {p1, v0, v1}, Lcn/cheln/explorer/ds/database/c;->a(Ljava/util/List;Lcn/cheln/explorer/ds/database/CategoryInfo;Landroid/net/Uri;)V

    new-instance v0, Lcn/cheln/explorer/ds/database/CategoryInfo;

    const-string v1, "apk"

    const v2, 0x7f05002d

    invoke-virtual {p0, v2}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v3

    const v4, 0x7f020001

    invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object v3

    invoke-direct {v0, v1, v2, v3}, Lcn/cheln/explorer/ds/database/CategoryInfo;-><init>(Ljava/lang/String;Ljava/lang/String;Landroid/graphics/drawable/Drawable;)V

    sget-object v1, Lcn/cheln/explorer/ds/a;->e:Landroid/net/Uri;

    invoke-static {p1, v0, v1}, Lcn/cheln/explorer/ds/database/c;->a(Ljava/util/List;Lcn/cheln/explorer/ds/database/CategoryInfo;Landroid/net/Uri;)V

    sget-object v0, Lcn/cheln/explorer/ds/database/c;->a:Ljava/util/Map;

    return-object v0
.end method

.method public static a(Landroid/content/Context;)V
    .locals 10

    const/4 v2, 0x0

    :try_start_0
    sget-object v1, Lcn/cheln/explorer/ds/a;->a:Landroid/net/Uri;

    invoke-static {p0, v1}, Lcn/cheln/explorer/ds/database/c;->a(Landroid/content/Context;Landroid/net/Uri;)V

    sget-object v1, Lcn/cheln/explorer/ds/a;->c:Landroid/net/Uri;

    invoke-static {p0, v1}, Lcn/cheln/explorer/ds/database/c;->a(Landroid/content/Context;Landroid/net/Uri;)V

    sget-object v1, Lcn/cheln/explorer/ds/a;->b:Landroid/net/Uri;

    invoke-static {p0, v1}, Lcn/cheln/explorer/ds/database/c;->a(Landroid/content/Context;Landroid/net/Uri;)V

    sget-object v1, Lcn/cheln/explorer/ds/a;->e:Landroid/net/Uri;

    invoke-static {p0, v1}, Lcn/cheln/explorer/ds/database/c;->a(Landroid/content/Context;Landroid/net/Uri;)V

    sget-object v1, Lcn/cheln/explorer/ds/a;->d:Landroid/net/Uri;

    invoke-static {p0, v1}, Lcn/cheln/explorer/ds/database/c;->a(Landroid/content/Context;Landroid/net/Uri;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1

    :goto_0
    :try_start_1
    sget-object v1, Lcn/cheln/explorer/ds/database/c;->a:Ljava/util/Map;

    invoke-interface {v1}, Ljava/util/Map;->values()Ljava/util/Collection;

    move-result-object v1

    invoke-interface {v1}, Ljava/util/Collection;->size()I

    move-result v1

    new-array v4, v1, [Lcn/cheln/explorer/ds/database/a;

    sget-object v1, Lcn/cheln/explorer/ds/database/c;->a:Ljava/util/Map;

    invoke-interface {v1}, Ljava/util/Map;->values()Ljava/util/Collection;

    move-result-object v1

    invoke-interface {v1, v4}, Ljava/util/Collection;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;

    array-length v5, v4

    move v6, v2

    :goto_1
    if-ge v6, v5, :cond_1

    aget-object v1, v4, v6

    instance-of v2, v1, Lcn/cheln/explorer/ds/database/b;

    if-eqz v2, :cond_4

    move-object v0, v1

    check-cast v0, Lcn/cheln/explorer/ds/database/b;

    move-object v3, v0

    invoke-static {v3}, Lcn/cheln/explorer/ds/database/c;->a(Lcn/cheln/explorer/ds/database/b;)V

    iget-object v2, v3, Lcn/cheln/explorer/ds/database/b;->d:Landroid/net/Uri;

    iget-object v7, v3, Lcn/cheln/explorer/ds/database/b;->a:Lcn/cheln/explorer/ds/database/CategoryInfo;

    const-string v8, " count(distinct _data) , sum(_size) "

    const-string v9, ""

    invoke-static {p0, v2, v7, v8, v9}, Lcn/cheln/explorer/ds/a;->a(Landroid/content/Context;Landroid/net/Uri;Lcn/cheln/explorer/ds/database/CategoryInfo;Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v2

    iput-object v2, v3, Lcn/cheln/explorer/ds/database/b;->b:Landroid/database/Cursor;

    iget-object v2, v3, Lcn/cheln/explorer/ds/database/b;->b:Landroid/database/Cursor;

    if-eqz v2, :cond_0

    iget-object v2, v3, Lcn/cheln/explorer/ds/database/b;->b:Landroid/database/Cursor;

    invoke-interface {v2}, Landroid/database/Cursor;->getCount()I

    move-result v2

    if-nez v2, :cond_2

    :cond_0
    move-object v0, v1

    check-cast v0, Lcn/cheln/explorer/ds/database/b;

    move-object p0, v0

    iget-object v1, p0, Lcn/cheln/explorer/ds/database/b;->a:Lcn/cheln/explorer/ds/database/CategoryInfo;

    const-string v2, "0"

    iput-object v2, v1, Lcn/cheln/explorer/ds/database/CategoryInfo;->count:Ljava/lang/String;

    :cond_1
    :goto_2
    return-void

    :cond_2
    iget-object v2, v3, Lcn/cheln/explorer/ds/database/b;->b:Landroid/database/Cursor;

    if-eqz v2, :cond_3

    iget-object v2, v3, Lcn/cheln/explorer/ds/database/b;->b:Landroid/database/Cursor;

    invoke-interface {v2}, Landroid/database/Cursor;->moveToFirst()Z

    move-object v0, v1

    check-cast v0, Lcn/cheln/explorer/ds/database/b;

    move-object v2, v0

    iget-object v2, v2, Lcn/cheln/explorer/ds/database/b;->a:Lcn/cheln/explorer/ds/database/CategoryInfo;

    new-instance v7, Ljava/lang/StringBuilder;

    invoke-direct {v7}, Ljava/lang/StringBuilder;-><init>()V

    iget-object v8, v3, Lcn/cheln/explorer/ds/database/b;->b:Landroid/database/Cursor;

    const/4 v9, 0x0

    invoke-interface {v8, v9}, Landroid/database/Cursor;->getInt(I)I

    move-result v8

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v7

    iput-object v7, v2, Lcn/cheln/explorer/ds/database/CategoryInfo;->count:Ljava/lang/String;

    move-object v0, v1

    check-cast v0, Lcn/cheln/explorer/ds/database/b;

    move-object v2, v0

    iget-object v2, v2, Lcn/cheln/explorer/ds/database/b;->a:Lcn/cheln/explorer/ds/database/CategoryInfo;

    iget-object v7, v3, Lcn/cheln/explorer/ds/database/b;->b:Landroid/database/Cursor;

    const/4 v8, 0x1

    invoke-interface {v7, v8}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v7

    long-to-float v7, v7

    invoke-static {v7}, Lcn/cheln/support/app/a;->a(F)Ljava/lang/String;

    move-result-object v7

    iput-object v7, v2, Lcn/cheln/explorer/ds/database/CategoryInfo;->size:Ljava/lang/String;

    check-cast v1, Lcn/cheln/explorer/ds/database/b;

    iget-object v1, v1, Lcn/cheln/explorer/ds/database/b;->a:Lcn/cheln/explorer/ds/database/CategoryInfo;

    iget-object v2, v3, Lcn/cheln/explorer/ds/database/b;->b:Landroid/database/Cursor;

    const/4 v7, 0x1

    invoke-interface {v2, v7}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v7

    invoke-static {v7, v8}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/Long;->floatValue()F

    move-result v2

    invoke-static {v2}, Ljava/lang/Float;->valueOf(F)Ljava/lang/Float;

    move-result-object v2

    iput-object v2, v1, Lcn/cheln/explorer/ds/database/CategoryInfo;->length:Ljava/lang/Float;

    :cond_3
    invoke-static {v3}, Lcn/cheln/explorer/ds/database/c;->a(Lcn/cheln/explorer/ds/database/b;)V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    :cond_4
    add-int/lit8 v1, v6, 0x1

    move v6, v1

    goto/16 :goto_1

    :catch_0
    move-exception v1

    invoke-virtual {v1}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_2

    :catch_1
    move-exception v1

    goto/16 :goto_0
.end method

.method private static a(Landroid/content/Context;Landroid/net/Uri;)V
    .locals 3

    :try_start_0
    invoke-virtual {p0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    const-string v1, "_data is null or _data like \'\'"

    const/4 v2, 0x0

    invoke-virtual {v0, p1, v1, v2}, Landroid/content/ContentResolver;->delete(Landroid/net/Uri;Ljava/lang/String;[Ljava/lang/String;)I
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    :cond_0
    :goto_0
    return-void

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;

    move-result-object v0

    const-string v1, "Unknown URI"

    invoke-virtual {v0, v1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_0

    goto :goto_0
.end method

.method private static a(Lcn/cheln/explorer/ds/database/b;)V
    .locals 1

    if-eqz p0, :cond_1

    iget-object v0, p0, Lcn/cheln/explorer/ds/database/b;->b:Landroid/database/Cursor;

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcn/cheln/explorer/ds/database/b;->b:Landroid/database/Cursor;

    invoke-interface {v0}, Landroid/database/Cursor;->isClosed()Z

    move-result v0

    if-nez v0, :cond_0

    iget-object v0, p0, Lcn/cheln/explorer/ds/database/b;->b:Landroid/database/Cursor;

    invoke-interface {v0}, Landroid/database/Cursor;->close()V

    :cond_0
    const/4 v0, 0x0

    iput-object v0, p0, Lcn/cheln/explorer/ds/database/b;->b:Landroid/database/Cursor;

    :cond_1
    return-void
.end method

.method private static a(Ljava/util/List;Lcn/cheln/explorer/ds/database/CategoryInfo;Landroid/net/Uri;)V
    .locals 3

    new-instance v0, Lcn/cheln/explorer/ds/database/b;

    invoke-direct {v0}, Lcn/cheln/explorer/ds/database/b;-><init>()V

    iput-object p1, v0, Lcn/cheln/explorer/ds/database/b;->a:Lcn/cheln/explorer/ds/database/CategoryInfo;

    iput-object p2, v0, Lcn/cheln/explorer/ds/database/b;->d:Landroid/net/Uri;

    sget-object v1, Lcn/cheln/explorer/ds/database/c;->a:Ljava/util/Map;

    iget-object v2, p1, Lcn/cheln/explorer/ds/database/CategoryInfo;->categorySign:Ljava/lang/String;

    invoke-interface {v1, v2, v0}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    sget-object v1, Lcn/cheln/explorer/ds/database/c;->a:Ljava/util/Map;

    const/4 v2, 0x0

    invoke-interface {v1, v2}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_0

    iget-object v0, v0, Lcn/cheln/explorer/ds/database/b;->a:Lcn/cheln/explorer/ds/database/CategoryInfo;

    invoke-interface {p0, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    :cond_0
    return-void
.end method
